"""django_server URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.conf.urls import url
from django.views.generic import TemplateView

# 自定义views & apis
from vue_app.apis import login
from vue_app.apis import cmdline
from vue_app.apis import deviceViews
from vue_app.apis import monitorViews
from vue_app.apis import mapViews

urlpatterns = [
    path('admin/', admin.site.urls),
    url("^$", TemplateView.as_view(template_name="index.html")),

    # 登陆接口
    # url("^/vue-admin-template/user/login", login.login_api, name="login.html")
    url("^prod-api/vue-admin-template/user/login", login.login_api, name="login"),
    url("^prod-api/vue-admin-template/user/info", login.getinfo_api, name="getinfo"),
    url("^prod-api/vue-admin-template/user/logout", login.logout_api, name="logout"),

    # 命令行api
    url("^prod-api/vue-admin-template/user/cmdline", cmdline.cmdline_api, name="cmdline"),

    # 设备管理接口
    url("^prod-api/vue-admin-template/user/initdevices", deviceViews.deviceInit, name="deviceInit"),
    url("^prod-api/vue-admin-template/user/deviceAdd", deviceViews.deviceAdd, name="deviceAdd"),
    url("^prod-api/vue-admin-template/user/deviceDel", deviceViews.deviceDel, name="deviceDel"),
    url("^prod-api/vue-admin-template/user/deviceEdit", deviceViews.deviceEdit, name="deviceEdit"),

    # 监控面板 - 数据墙
    url("^prod-api/vue-admin-template/user/initDataWall", monitorViews.initDataWall, name="initDataWall"),
    url("^prod-api/vue-admin-template/user/datawall", monitorViews.dataWall, name="dataWall"),

    # 地图面板
    url("^prod-api/vue-admin-template/user/mapservice$", mapViews.mapservice, name="mapservice"),
    # 文件上传测试
    url("^prod-api/vue-admin-template/user/uploads", mapViews.uploads, name="uploads"),
    # 文件下载测试
    url("^prod-api/vue-admin-template/user/mapservice/download", mapViews.downloads, name="downloads")
]
